package com.ep.general;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class ActionSupportCustom<T> extends ActionSupport implements
		SessionAware {

	private static final long serialVersionUID = -3070682666855791359L;

	public static final String TEXT_RESULT = "text";
	public static final String DATA_ARRAY = "dataArray";
	public static final String START_PAGE = "start";
	public static final String LOGGED_USER = "loggedUser";
	public static final String EDIT = "edit";
	public static final String JSON_RESULT = "json";

	private String text;
	private String dataArray;

	private String jsonResponse;

	private Map<String, Object> session;

	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	public Map<String, Object> getSession() {
		return session;
	}

	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getDataArray() {
		return dataArray;
	}

	public void setDataArray(String dataArray) {
		this.dataArray = dataArray;
	}

	@SuppressWarnings("unchecked")
	public T getLoggedUser() {
		return (T) getSession().get(LOGGED_USER);
	}

	public String getJsonResponse() {
		return jsonResponse;
	}

	public void setJsonResponse(String jsonResponse) {
		this.jsonResponse = jsonResponse;
	}

}
